1. Field of the Invention
The present invention relates to a rewritable optical recording medium and more particularly, to a method for real time recording/playback of data to/from an optical recording medium and a method for managing a file thereof.
2. Background of the Related Art
An optical recording medium includes a Read Only memory (ROM), a Write Once Read Many (WORM) time memory, and a rewritable memory which allows repeated writing. The ROM type of optical recording medium further includes a Compact Disc Read Only Memory (CD-ROM) and a Digital Versatile Disc Read Only Memory (DVD-ROM). The WORM type of optical recording medium further includes a Recordable Compact Disc (CD-R) and a Recordable Digital Versatile Disc (DVD-R). The rewritable type further includes a Rewritable Compact Disc (CD-RW) and a Rewritable Digital Versatile Disc (DVD-RW, DVD-RAM and DVD+RW).
For the rewritable optical recording mediums, the repeated recording and playback (R/P) of information to and from the rewritable optical recording medium changes an initial mixture ratio of a recording layer formed to write data on the optical disk. This change degrades performance of the optical recording medium, causing errors in R/P of the data information. A degraded region of an optical disk creates a defective area for formatting, writing to and playback from the optical recording medium. Moreover, a defective area in a rewritable optical recording medium can also be caused by scratches on the surface, dusts and defects in production.
To prevent R/P of data to/from a defective area formed by any of the above causes, management of the defective area is required. Thus, Defect Management Areas (DMAs) are provided in lead-in areas and in lead-out areas of the optical recording for managing defective regions of the optical recording medium, as shown in FIG. 1. Also, a data area is managed in groups, each having a user area for actual recording of data and a spare area for use in a case of defect in the user area.
Typically, one disc (e.g. DVD-RAM) has four DMAs, two in the lead-in area and two in the lead-out area. Since managing defect areas is important, the same data are held in all four DMAs, for data protection. Each DMA includes two blocks of 32 sectors, wherein one block consists of 16 sectors. The first block (DDS/PDL block) of each DMA includes a disc definition structure (DDS) and a primary defect list (PDL), and the second block (SDL block) includes a secondary defect list (SDL).
More specifically, the PDL represents a primary defect data storage area, and the SDL represents a secondary defect data storage area. The PDL stores entries of all defective sectors generated during manufacture and identified during formatting such as initialization or re-initialization. Each entry includes a sector number corresponding to a defective sector and an entry type.
On the other hand, the SDL is arranged by blocks and stores entries of either defective areas which may be generated after initialization, or defective areas which cannot be entered in the PDL during initialization. Each entry of the SDL includes an area storing the sector number of a first sector of the block having a defective sector, and an area holding the sector number of a first sector of an alternate block. Defective areas in the data area (i.e. defective sectors or defective blocks) are replaced with new sectors or blocks, respectively by slipping replacement or linear replacement.
The slipping replacement is utilized when a defective area or sector is listed in the PDL. As shown in FIG. 2A, if defective sectors m and n, corresponding to sectors in the user area, are recorded in the PDL, such defective sectors are replaced by the next available sector. By replacing the defective sectors by subsequent sectors, data is written to a normal sector. As a result, the user area into which data is written slips and occupies the spare area in the amount equivalent to the defective sectors.
The linear replacement is utilized when a defective area or block is recorded in the SDL. As shown in FIG. 2B, if defective sectors m and n, corresponding to sectors in either the user or spare area, are recorded on the SDL, such defective blocks are replaced by normal blocks in the spare area and the data to be recorded in the defective block are recorded in an assigned spare area. To achieve the replacement, a physical sector number (PSN) assigned to a defective block remains, while a logical sector number (LSN) is moved to the replacement block along with the data to be recorded. Linear replacement is effective for non real-time processing of data.
FIG. 3 is partial diagram of an optical disc recording/playback device relating to the write operation. The optical disc R/P device includes an optical pickup to write data into and playback data from the optical disc; a pickup controller transferring or moving the optical pickup; a data processor either processing and transferring the input data to the optical pickup, or receiving and processing the data reproduced through the optical pickup; an interface and a micro processor (micom) controlling the components.
Also, a host may be connected to the interface of the optical disc R/P device to transfer commands and data to and from the host and R/P device. Such a host can be any kind of personal computer, and would manage the optical disc R/P device.
Referring to FIG. 3, when data to be written is provided, the host provides a write command to the device for R/P of the data to/from an optical recording medium. The write command is inclusive of a Logical Block Address (LBA) which designates a writing position and a transfer length providing the size of the data. The host then provides the data to be written to the device for R/P of data to/from an optical recording medium. Upon reception of the data, the device for R/P of data writes the data starting from the designated LBA. At this time, the R/P device does not write data on defective areas, utilizing the PDL and the SDL which indicate defects on the optical recording medium.
Namely, the physical sectors listed on the PDL are skipped during the writing. As shown in FIG. 4A, physical blocks sb1kA and sb1kB listed on the SDL are replaced with replacement blocks sb1kC and sb1kD assigned to the spared area in the writing. Also, during the writing or playback of data, if a defective block not listed on the SDL or a block with a high possibility of error occurrence is present, the block is regarded as a defective block. Thus, a replacement block is located in the spare area, data of the defective block is written again into the replacement block, and a first sector number of the defective block and a first sector number of the replacement block are listed on the SDL entry.
Referring to FIG. 4A, for file 1, a conceptual expression of a portion representing a starting position and a size of file in an Information Control Block (ICB) having the file information written thereon in an Universal Disc Format (UDF) file may be shown as in FIG. 4B. As file 1 starts from position xe2x80x98Axe2x80x99, a defective block sb1kB in file 1 is replaced with a spare block sb1kD in the spare area. Thus, the number of logical sectors remains and a size of sector for file 1 is xe2x80x98Nxe2x80x99.
In order to write data by replacing defective blocks listed on the SDL with a replacement block assigned in the spare area, the optical pickup must be shifted to the spare area and returned back to the user area. However, the time period required for shifting and returning back interferes with a real time recording. Accordingly, many defective area management methods for real time recording are suggested. One of such methods is a skipping method in which the linear replacement is not performed when using the SDL, but data of an encountered defective block is written on a good block subsequent to the defective block as in the slipping replacement. As a result, the shifting time of the optical pickup in a real time recording can be reduced because the optical pickup is not required to shift to the spare area every time the optical pickup encounters a defective block.
At this time, the defective block retains the LSN and PSN. However, from the viewpoint of the host, the number of logical sectors in an optical disc is fixed. Thus, skipping causes losses of LSN in view of the host, equivalent to the number of skipped blocks, because LSNs are allocated to the skipped defective blocks even if data is not written on the defective block. For example, even if data of 100 sectors are transmitted for writing from the host and if there is one defective block in the area, only 84 sectors (1 block=16 sectors) are written.
Therefore, for file 1 in FIG. 4C, the size can be represented as N or N-L, shown in FIG. 4D, in an ICB of a UDF file system. The xe2x80x98Lxe2x80x99 denotes a number of defective sectors skipped in an area on which file 1 is written. As shown in FIG. 4C, data of file 1 is written from position xe2x80x98Axe2x80x99 for xe2x80x98Mxe2x80x99 sectors until a defective block is encountered. The defective block is skipped, and the writing of file 1 is continued. However, since the defective block sb1kB retains the LSN without writing data on the defective block sb1kB, the optical disk R/P device writes data only on N-L sectors when the host provides a command to write data on N sectors, because the LSN of the defective block sb1kB cannot be used.
Consequently, if file 1 size is represented with xe2x80x98Nxe2x80x99 as in the first case of FIG. 4D, an actual file size and a written file size differs, causing a problem in management of the file by a file manager. On the other hand, if the size of file 1 is represented with xe2x80x98N-Lxe2x80x99 as in the second case, an inconsistency of the LSNs occurs. For example, if file 3 is newly written after file 2 in FIG. 4C has been erased, the file manager of the host would generate a command to write the data of file 3 starting from C-L position, where L is the number of sectors with defects. As a result, data of file 1, previously written, would be damaged. Thus, when a real time data is written according to the aforementioned method, the file manager can make mistakes in the management of the files.
Also, the LSNs retained by the defective areas during a real time recording cannot be utilized and an amount of data corresponding to such LSNs cannot be recorded. Therefore, effectively, a reduction of the disk size occurs. This is because data is written in fixed units in response to write command from the host regardless of whether defective blocks or defective sectors exists in an area in which the data is written.
Accordingly, an object of the present invention is to solve at least the problems and disadvantages of the related art.
An object of the present invention is to provide a method for real time R/P of data to/from an optical recording medium, by providing a write command using information from a defective area returned from a device for R/P of data on an optical disk.
Another object of the present invention is to provide a method for real time management of files in an optical disk.
A further object of the present invention is to provide a method for managing files in an optical disk with the capability to manage real time data using defective block information.
A still further object of the present invention is to provide a method for managing files in an optical disk with the capability to manage real time data using skipped defective block information.
A still further object of the present invention is to provide a method for real time R/P of data on an optical recording medium, in which a device for R/P of data on an optical disk reads out and excludes defective areas before writing the data when a real time data is provided.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objects and advantages of the invention may be realized and attained as particularly pointed out in the appended claims.
To achieve the objects and in accordance with the purposes of the invention, as embodied and broadly described herein, a method for real time R/P of data to/from an optical recording medium includes (1) generating a control signal requesting information on a defective area if data to be written in real time is generated, and forwarding the control signal to the device for R/P of data to/from the optical medium; (2) providing the information on the defective area to the controller when the control signal is received; and (3) generating the write command such that data is not written on the defective area when the information on the defective area is returned in step (2), and providing the write command together with the data to be written in real time to the device for R/P of data to/from the optical medium.
More particularly, the information regarding the defective area which is returned to the controller may be positional information of the defective area listed on a defect management area. The information regarding the defective area returned to the controller may also be a positional information on a defective block listed on a secondary defect list. Such information may further includes a first sector number of each defective block. Moreover, such information regarding the defective area which is returned to the controller retains a logical sector number. Finally, the information regarding the defective area returned to the controller may be positional information on defective areas listed on a PDL and a SDL.
If a new defective block is encountered during the writing of data in response to a write command, the new defective block is skipped and the data is written on a good block subsequent the new defective block.
The above method may further include repeating the steps of terminating the write command and returning information regarding a new defective block to the controller; generating a new write command when such information is returned; and providing to the device for R/P of data to the optical disk every time a new defective block is encountered during writing the data in response to the write command. The above method may further include the step of writing the data on the defective block as is if a new defective block is encountered during writing the data in response to the write command.
In another aspect of the present invention, a method for managing data files recorded on an optical recording medium in a device for R/P of data to/from the optical medium for writing the data from a controller on the optical recording medium in response to a write command is provided. The method comprises (1) generating a control signal for requesting information on a defective area if data to be written in real time is generated, and forwarding the control signal to the device for R/P of data to/from the optical medium; (2) providing the information on the defective area to the controller when the control signal is received; (3) generating the write command such that data is not written on the defective area when the information on the defective area is returned in step (2) and providing the write command together with the data to be written in real time to the device for R/P of the data to/from the optical medium; and (4) writing information on a file architecture with reference to the information on the defective area on the optical recording medium when the real time data recording is completed in response to the write command.
The above method may further include terminating the write command if a new defective block is encountered during writing the data on the optical recording medium in response to the write command, and returning the information on the defective block to the controller; and generating a new write command when the information on the defective block is returned and providing the new write command to the device for R/P of data to an optical disk.
The information regarding the defective block which is returned to the controller may be a written sector number until the defective area is encountered since the writing is started in response to the write command and a consecutive defective sector number. The information regarding the defective block which is returned to the controller may be returned with the information on the defective block written on an unused area in request sense data.
If a new defective block is encountered during the writing of data on the optical recording medium in response to the write command, the above method may further include skipping the defective block and writing the data on a good block subsequent to the defective block, and returning the information on the skipped defective blocks to the controller if the write command provided from the controller is terminated during the foregoing step. The information on the skipped defective block may be returned with the information written on an additional area of the request sense data, and an added length is stored. An Information Control Block (ICB) written out for one file is separated by the returned defective area, and the defective area is not written on the ICB.
Still, in another aspect of the present invention, a method for real time R/P of data to/from an optical recording medium is provided, including the steps of (1) returning information on a defective block present in a writing area designated by the write command to the controller upon reception of the write command for making a real time recording from the controller; (2) generating a new write command and providing to the device for R/P of data to/from an optical disk when the information on the defective block is returned in the above step; and (3) writing the data in response to the write command provided in the above step. An ICB written out for one file is separated by the returned defective area when the writing for one file is finished in the above step, and the defective area is not written on the ICB.
In a still further aspect of the present invention, a method for managing files in a device for R/P of data on an optical recording medium for, if data to be written is generated, writing the data on the optical recording medium is provided, including the steps of(1) reading information on a defective area if data to be written in a real time is generated; (2) writing the data to be written in real time excluding the defective area read in step (1); and (3) writing file architecture on the optical recording medium with reference to the information on the defective area upon completion of writing of the data to be written in real time. The file architecture (ICB) written out for one file is separated by the defective area, and the defective area is not written on the file architecture (ICB).